1 using System.Collections;
2 using
System.Collections.Generic;
3 using
UnityEngine;
4
5 public
class BossController : MonoBehaviour {
6
7     
public float speed;
8     
public Transform targetPoint;
9
10
11     
void Awake(){
12         targetPoint = GameObject.Find (
"Target Point").transform;
13     }
14
15     
// Use this for initialization
16     
void Start () {
17         
18     }
19     
20     
// Update is called once per frame
21     
void Update () {
22         
if (transform.position != targetPoint.position) {
23             transform.position = Vector3.MoveTowards (transform.position, targetPoint.position, speed * Time.deltaTime);
24         }
else {
25             transform.GetComponent<BossHealth> ().invulnerable =
false;
26             transform.GetComponent<BossShoot> ().isReadyToShoot =
true;
27         }
28     }
29 }


Use this for initialization

Update is called once per frame



Gõ tìm kiếm nhanh...